<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<% String path=pageContext.getServletContext().getContextPath(); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>已就诊</title>
<link rel="stylesheet" type="text/css" href="<%=path %>/eazyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=path %>/eazyui/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=path %>/eazyui/demo/demo.css">
	<script type="text/javascript" src="<%=path %>/eazyui/jquery.min.js"></script>
	<script type="text/javascript" src="<%=path %>/eazyui/jquery.easyui.min.js"></script>
	<style type="text/css">
	#content{
		width:90%;
		padding:10px;
		margin:0 auto;
	}
	</style>
	<script type="text/javascript">
	function onLoadSuccess(){
		$("a[name='showRbtn']").linkbutton({
			iconCls:''
		});
		$("a[name='showCbtn']").linkbutton({
		    iconCls:''
		});
	}
	function formatterBtn(value,row,index){
		var str = '<a href="#" class="easyui-linkbutton" title="查看挂号信息" onclick="showReg(&quot;'+row.guahao_id+'&quot;,'+index+');">查看挂号信息</a> &nbsp;&nbsp;'		
		  +'<a href="#" class="easyui-linkbutton" title="查看诊断信息" onclick="showCheck(&quot;'+row.guahao_id+'&quot;,'+index+');">查看诊断信息</a> &nbsp;&nbsp;'
		  +'<a href="<%=path %>/WM?guahao_id='+row.guahao_id+'" class="easyui-linkbutton" title="转到处方页面" >转到处方页面</a> &nbsp;&nbsp;';
		return str;
		}
	
	function showReg(guahao_id,index){
		$("#Reg").window("open");
		if(true){
			$.get("<%=path %>/checked/getRegisterByGuahaoId",{guahao_id:guahao_id},function(data,textStatus){
				$("#guahao_id").textbox("setValue",data.guahao_id);
				$("#card_id").textbox("setValue",data.card_id);
				$("#feiyong_type").textbox("setValue",data.feiyong_type);
				$("#chufuzhen_type").textbox("setValue",data.chufuzhen_type);
				$("#guahao_type").textbox("setValue",data.guahao_type);
				$("#dept_id").textbox("setValue",data.dept_id);
				$("#doctor_id").textbox("setValue",data.doctor_id);
				$("#guahao_fei").textbox("setValue",data.guahao_fei);
				$("#zhenduan_type").textbox("setValue",data.zhenduan_type);
			})
		}
	}
	function showCheck(guahao_id,index){
		$("#Checked").window("open");
		if(true){
			$.get("<%=path %>/checked/getDiagnosisByZhenduanId",{guahao_id:guahao_id},function(data,textStatus){
				$("#diagnose_id").textbox("setValue",data.diagnose_id);
				$("#guahao_id").textbox("setValue",data.guahao_id);
				$("#patient_telling").textbox("setValue",data.patient_telling);
				$("#present_illness").textbox("setValue",data.present_illness);
				$("#past_illness").textbox("setValue",data.past_illness);
				$("#allergy_illness").textbox("setValue",data.allergy_illness);
				$("#date_illness").textbox("setValue",data.date_illness);
				$("#diagnose_content").textbox("setValue",data.diagnose_content);
				$("#diagnose_remark").textbox("setValue",data.diagnose_remark);
				$("#plan_illness").textbox("setValue",data.plan_illness);
			})
		}	  
	}
	function TO(guahao_id,index){
		
		$.post("<%=path %>/WM",{guahao_id:guahao_id});
	}
	</script>
</head>
<body>
		<div id="content">
		<table id="dg" class="easyui-datagrid" style="width: 100%" data-options="onLoadSuccess:onLoadSuccess">
	    <thead>
			<tr>
				<th field="guahao_id" width=30%>挂号Id</th>
				<th field="patient_name" width="30%">病人姓名</th>
				<th data-options="field:'action',formatter:formatterBtn" width="40%">操作</th>
			</tr>
	    </thead>
	    <tbody>
	    <c:forEach items="${list }" var="patient">
	    	<tr>
				<td>${patient.guahao_id }</td>
				<td>${patient.patient.patient_name }</td>
			</tr>
		</c:forEach>	
		</tbody>
	</table>
	</div>
	
<div id="content">
	<div id="Reg" class="easyui-window" title="查询挂号信息" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:500px;height:300px;padding:10px;">
		<div style="margin:0 auto;width:60%;">
		<input id="editIndex" type="hidden">
			<h3>查询挂号信息</h3>
			<hr />
			<div style="margin:5px auto;">
				<div>挂号Id：</div>
				<input class="easyui-textbox" id="guahao_id" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>卡号：</div>
				<input class="easyui-textbox" id="card_id" style="width:100%;height:25px;"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>费用类型（0-自费，1-公费）:</div>
				<input class="easyui-textbox" id="feiyong_type" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>初复诊类型（0-初诊，1-复诊）:</div>
				<input class="easyui-textbox" id="chufuzhen_type" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>挂号类型（0-普通号，1-专家号）:</div>
				<input class="easyui-textbox" id="guahao_type" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>科室Id:</div>
				<input class="easyui-textbox" id="dept_id" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>医生Id:</div>
				<input class="easyui-textbox" id="doctor_id" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
			<div>挂号费用:</div>
				<input class="easyui-textbox" id="guahao_fei" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
			<div>诊断属性（0-未就诊，1-已就诊）:</div>
				<input class="easyui-textbox" id="zhenduan_type" style="width:100%;height:25px"readonly="true">
			</div>	
	    </div>
	 </div>
	 
	 <div id="Checked" class="easyui-window" title="查询诊断信息" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:500px;height:300px;padding:10px;">
		<div style="margin:0 auto;width:60%;">
		<input id="editIndex" type="hidden">
			<h3>查询诊断信息</h3>
			<hr />
			<div style="margin:5px auto;">
				<div>诊断Id：</div>
				<input class="easyui-textbox" id="diagnose_id" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>挂号Id：</div>
				<input class="easyui-textbox" id="guahao_id" style="width:100%;height:25px;"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>主诉:</div>
				<input class="easyui-textbox" id="patient_telling" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>现病史:</div>
				<input class="easyui-textbox" id="present_illness" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>以往病史:</div>
				<input class="easyui-textbox" id="past_illness" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>过敏史:</div>
				<input class="easyui-textbox" id="allergy_illness" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
				<div>发病日期:</div>
				<input class="easyui-textbox" id="date_illness" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
			<div>诊断内容:</div>
				<input class="easyui-textbox" id="diagnose_content" style="width:100%;height:25px"readonly="true">
			</div>
			<div style="margin:5px auto;">
			<div>诊断备注:</div>
				<input class="easyui-textbox" id="diagnose_remark" style="width:100%;height:25px"readonly="true">
			</div>
			<div>处置计划:</div>
				<input class="easyui-textbox" id="plan_illness" style="width:100%;height:25px"readonly="true">
			</div>		
	    </div>
	 </div>
	 
</div>>
	
	
</body>
</html>